<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>用户注册</title>
	<link rel="stylesheet" href="{:config('home_static')}/style/base.css" type="text/css">
	<link rel="stylesheet" href="{:config('home_static')}/style/global.css" type="text/css">
	<link rel="stylesheet" href="{:config('home_static')}/style/header.css" type="text/css">
	<link rel="stylesheet" href="{:config('home_static')}/style/login.css" type="text/css">
	<link rel="stylesheet" href="{:config('home_static')}/style/footer.css" type="text/css">
	<script type="text/javascript" src="{:config('home_static')}/js/jquery-1.8.3.min.js"></script>
	<script type="text/javascript" src="/plugin/layer/layer.js"></script>
</head>
<body>
<!-- 顶部导航 start -->
{include file="public/nav" /}
<!-- 顶部导航 end -->
	
	<div style="clear:both;"></div>

	<!-- 页面头部 start -->
	<div class="header w990 bc mt15">
		<div class="logo w990">
			<h2 class="fl"><a href="{:url('home/index/index')}"><img src="{:config('home_static')}/images/logo.png" alt="京西商城"></a></h2>
		</div>
	</div>
	<!-- 页面头部 end -->
	
	<!-- 登录主体部分start -->
	<div class="login w990 bc mt10 regist">
		<div class="login_hd">
			<h2>设置新密码</h2>
			<b></b>
		</div>
		<div class="login_bd">
			<div class="login_form fl">
				<form action="" method="post">
					<!-- 获取链接地址上面的参数member_id -->
					<input type="hidden" name="member_id" value="{$member_id}">
					<ul>
						
						<li>
							<label for="">密码：</label>
							<input type="password" class="txt" name="password" />
							<p>6-20位字符，可使用字母、数字和符号的组合，不建议使用纯数字、纯字母、纯符号</p>
						</li>
						<li>
							<label for="">确认新密码：</label>
							<input type="password" class="txt" name="repassword" />
							<p> <span>请再次输入密码</p>
						</li>
						
						<li>
							<label for="">&nbsp;</label>
							<input type="button" id="updPassword" value="设置新密码"  />
						</li>
					</ul>
				</form>

				
			</div>
			
			<div class="mobile fl">
				<h3>手机快速注册</h3>			
				<p>中国大陆手机用户，编辑短信 “<strong>XX</strong>”发送到：</p>
				<p><strong>1069099988</strong></p>
			</div>

		</div>
	</div>
	<!-- 登录主体部分end -->   

	<div style="clear:both;"></div>
	<!-- 底部版权 start -->
	{include file="public/foot" /}
	<!-- 底部版权 end -->

</body>
<script type="text/javascript">
	//ajax修改密码
	$("#updPassword").click(function(){
		//接收用户输入的密码和用户的id
		var member_id = $("input[name='member_id']").val();
		var password = $("input[name='password']").val();
		var repassword= $("input[name='repassword']").val();
		var param = {"member_id":member_id,"password":password,"repassword":repassword};
		//自行完成两次密码是否一致
		$.post("{:url('home/public/updpassword')}", param, function(json) {
			/*optional stuff to do after success */
			if(json.code == 200){
				//询问框
				layer.confirm(json.message, {
				  btn: ['好的','算了'] //按钮
				}, function(){
					//用户点了好的按钮逻辑
				 	location.href = "{:url('home/public/login')}";
				}, function(){
					//用户点了算了的按钮逻辑
				    layer.msg(json.message,{"icon":1,"time":1500});
				});
			}
		},'json');
	});
</script>
</html>